Ext.define('appmod.view.user.DefaultListView', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.defaultlistview',
    margins:"5 5 0 5",
    region : 'center',
    title: '系统应用用户帐户',
	requires:[
		'Ext.ux.form.SearchField'
	],	

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
            columns: [
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'name',
					minWidth:200,
                    text: '登陆帐号'
                },
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'mobilephone',
                    minWidth:130,
					text: '手机号码'
                },
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'email',
                    text: '电子邮箱'
                },
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'officephone',
                    text: '办公电话'
                },
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'qq',
                    text: 'QQ'
                }, 				   				                                
                {
                    xtype: 'booleancolumn',
                    dataIndex: 'disabled',
                    text: '禁止使用',
					trueText:'是',
					falseText:'否'					
                },
                {
                    xtype: 'numbercolumn',
                    dataIndex: 'String',
                    text: '描 述'
                }
            ],
            viewConfig: {

            },
            selModel: Ext.create('Ext.selection.CheckboxModel', {
                allowDeselect: true
            }),            
            dockedItems: [
                {
                    xtype: 'pagingtoolbar',
                    width: 360,
					store:me.store,
                    displayInfo: true,
                    dock: 'bottom'
                },
                {
                    xtype: 'toolbar',
                    dock: 'top',
                    items: [
                        {
                            xtype: 'splitbutton',
                            text: '帐号基本操作',
                            menu: {
                                xtype: 'menu',
                                width: 120,
                                items: [
                                    {
                                        xtype: 'menuitem',
                                        text: '新增系统帐号',
										action : 'addsimpleuser'
                                    },
                                    {
                                        xtype: 'menuitem',
                                        text: '更新系统帐号',
										action : 'updatesimpleuser'
                                    },
                                    {
                                        xtype: 'menuitem',
                                        text: '删除系统帐号',
										action : 'deleteusers'
                                    },
                                    {
                                        xtype: 'menuitem',
                                        text: '更新用户密码'
                                    },
                                    {
                                        xtype: 'menuitem',
                                        text: '选择角色',
										action : 'selectroles'
                                    }									
                                ]
                            }
                        },'-',
						{
					        width: 400,
					        fieldLabel: '帐号查询',
					        labelWidth: 60,
					        xtype: 'searchfield'
					        //store: me.store
				        }						
                    ]
                }
            ],
			listeners:{
				
			}
        });

        me.callParent(arguments);
    },
	
	bindStore:function(store) {
		var me = this;
		
		var pagingbar = me.down('pagingtoolbar');
		pagingbar.bindStore(store);
		
		var searchField = me.down('searchfield');
		searchField.bindStore(store);
		me.callParent(arguments);		
	}
	
	
	
	
});